package com.base.cn.platform.os.service.exam.collect;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.exam.ExamBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 试题收藏接口
 *
 * @author s.li
 * @date 2018/12/12
 */
@FeignClient(name = ExamBaseService.appName,configuration = FeignAuthConfig.class)
public interface ExamQuestionCollectService extends ExamBaseService {

    /**
     * 删除试题收藏记录
     * @param userId 用户ID
     * @param ids 收藏记录ID串
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/deleteExamQuestionCollect")
    Map<String,Object> deleteExamQuestionCollect(@RequestParam("userId") BigDecimal userId,
                                                 @RequestParam("ids") String ids);

    /**
     * 收藏试题
     * @param userId 用户ID
     * @param examRecordId 考试记录ID
     * @param questionId 试题ID
     * @param type 类型，1.仿真测验 2.考点练习 3.错题练习 4.自由组卷
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/saveExamQuestionCollect")
    Map<String,Object> saveExamQuestionCollect(@RequestParam("userId") BigDecimal userId,
                                               @RequestParam("examRecordId") BigDecimal examRecordId,
                                               @RequestParam("questionId") BigDecimal questionId,
                                               @RequestParam("type") int type);

    /**
     * 多条件查询试题记录列表
     * @param condition 查询数据列表
     * @return List<Map<String,Object>>
     */
    @RequestMapping(contextPath + "/findExamQuestionCollectList")
    List<Map<String,Object>> findExamQuestionCollectList(@RequestBody Map<String, Object> condition);

    /**
     * 加载试题收藏数据列表
     * @param condition 查询条件
     * @param currentPage 页码
     * @param pageSize 数量
     * @return PageInfo<ExamQuestionCollect>
     */
    @RequestMapping(contextPath + "/findExamQuestionCollectListPage")
    Map<String,Object> findExamQuestionCollectListPage(@RequestBody Map<String, Object> condition,
                                                       @RequestParam("currentPage") int currentPage,
                                                       @RequestParam("pageSize") int pageSize);
}
